VPATH += ../Include ../StreamBuf ../Task_Base ../TcpPackBuf ../ #包含路徑

#CC = g++

CXXFLAGS =  -g  #重新定義g++編譯規則

COFLAGS	 = -MM

#path1:= $(patsubst %:,%/*.cpp ,$(VPATH))

#OBJ := $(patsubst %.cpp,%.o,$(wildcard $(path1)))

Includefile = ../srv_asynch_man.h

OBJ = Srv_Service_Handler.o StreamBuf.o Task_Base.o EventImpl.o	TcpPackBuf.o asynch_return_queue.o asynch_read_queue.o asynch_write_queue.o epoll_impl.o srv_asynch_man.o

LIB = libepoll.a

all: $(LIB)

$(LIB) : $(OBJ)
	$(AR) -r $@ $^


%.d: %.cpp
	@set -e; rm -f $@
	$(CXX) $(COFLAGS) $< > $@.$$$$; sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@ ;rm -f $@.$$$$

include $(OBJ:.o=.d)

#install:
#	cp $(LIB) /usr/lib 
#	cp $(Includefile) /usr/include
#	@echo copy $(LIB) and $(notdir $(Includefile)) to system path ...

#$(OBJ): %.o: %.cpp
#	$(CC) $(CFLAGS) $<

###############
#Srv_Service_Handler.o	: Srv_Service_Handler.cpp Srv_Service_Handler.h srv_asynch_man.h 
#	$(CC) $(CFLAGS)  $<
#StreamBuf.o				: StreamBuf.cpp StreamBuf.h
#	$(CC) $(CFLAGS)  $<
#Task_Base.o				: Task_Base.cpp Task_Base.h EventImpl.h CriticalSection.h
#	$(CC) $(CFLAGS)  $<
#EventImpl.o				: EventImpl.cpp EventImpl.h
#	$(CC) $(CFLAGS)  $<
#TcpPackBuf.o			: TcpPackBuf.cpp TcpPackBuf.h
#	$(CC) $(CFLAGS)  $<
#asynch_read_queue.o		: asynch_read_queue.cpp Task_Base.h asynch_read_queue.h srv_asynch_man.h CriticalSection.h TcpPackBuf.h
#	$(CC) $(CFLAGS)  $<
#asynch_write_queue.o	: asynch_write_queue.cpp Task_Base.h asynch_write_queue.h srv_asynch_man.h CriticalSection.h TcpPackBuf.h
#	$(CC) $(CFLAGS)  $<
#epoll_impl.o			: epoll_impl.cpp epoll_impl.h srv_asynch_man.h
#	$(CC) $(CFLAGS)  $<
#srv_asynch_man.o		: srv_asynch_man.cpp srv_asynch_man.h epoll_impl.h Srv_Service_Handler.h CriticalSection.h asynch_read_queue.h asynch_write_queue.h
#	$(CC) $(CFLAGS)  $<
#	$(basename ...)
clean:
	-rm $(OBJ) $(LIB)
	@echo Clear...  $(OBJ)
